import Cookies from 'js-cookie'

const TokenKey = 'foxie'
const inOneDay = new Date(new Date().getTime() + 60 * 60 * 24 * 1000); // 当前时间 + 1天（毫秒）
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  // return Cookies.set(TokenKey, token)
  return Cookies.set(TokenKey, token, { expires: inOneDay })
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
